<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>文章列表--layui后台管理模板 2.0</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../css/public.css" media="all" />
	<link rel="stylesheet" href="../../css/my.css" media="all" />
	
</head>
<body class="childrenBody">
	<div class="layui-form one" lay-filter="LAY-form-list" style="padding: 20px 30px 0 0;">
  		<input type="hidden" name="id" value="${student.id}">
  		<div class="layui-form-item">
			<label class="layui-form-label required">姓名</label>
			<div class="layui-input-block">
				<input type="text" name="name" value="${student.name}" lay-verify="required" class="layui-input" placeholder="姓名" />
			</div>
		</div>	
		<div class="layui-form-item">
			<label class="layui-form-label required">账号</label>
			<div class="layui-input-block">
				<input type="text" name="uname" value="${student.uname}" lay-verify="required" class="layui-input" placeholder="账号" />
			</div>
		</div>		
		
		<div class="layui-form-item">
			<label class="layui-form-label required">密码</label>
			<div class="layui-input-block">
				<input type="text" name="passwd" value="${student.passwd}" lay-verify="required" class="layui-input" placeholder="密码" />
			</div>
		</div>	
		<div class="layui-form-item openness">
			<label class="layui-form-label"><i class="seraph icon-look"></i> 性别</label>
			<div class="layui-input-block">
				<input type="radio" name="sex" value="1" title="男" lay-skin="primary" <c:if test="${student.sex==1}">checked</c:if> />
				<input type="radio" name="sex" value="0" title="女" lay-skin="primary" <c:if test="${student.sex==0}">checked</c:if> />
			</div>
		</div>
		
  		<div class="layui-form-item">
			<label class="layui-form-label required">日期</label>
			<div class="layui-input-block">
				<input type="text" id="ctime" name="ctime" value="${student.ctime}"  class="layui-input" disabled="disabled"/>
			</div>
		</div>	
		
	    <div class="layui-form-item layui-hide">
	      	<input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认添加">
	      	<input type="button" lay-submit lay-filter="LAY-form-edit" id="LAY-form-edit" value="确认编辑">
	    </div>
	    
  	</div>

	
<script type="text/javascript" src="${path}/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${path}/layui/layui.js"></script>
<script type="text/javascript" src="${path}/js/commons.js"></script>
<script>
layui.use(['form'],function(){
    var form = layui.form;
      
  	//监听提交
	form.on('submit(LAY-form-submit)', function(data) {
  		var index = parent.layer.getFrameIndex(window.name); 
  		$$.ajax({
  			url: '${path}/action/student/save',
  			data: data.field,
  			success: function(json) {
  				parent.layui.table.reload('LAY-table');
  	      		parent.layer.close(index);	
  			}
  		});
	}); 


});
layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  
	  //执行一个laydate实例
	  laydate.render({
			elem: '#ctime'
			,value: new Date() //当前时间
			,isInitValue:true
		});	
	});


</script>
</body>
</html>